package pl.gwt.client.gui;

import pl.gwt.client.CRMEntryPoint;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ImageBundle;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.Widget;

public class Calendar extends Composite {

	public interface Images extends ImageBundle {
		AbstractImagePrototype calendarPhoto();
	}

	final CalendarWidget calendar = new CalendarWidget();

	public Calendar(Images images) {
		SimplePanel outer = new SimplePanel();
		calendar.addChangeListener(new ChangeListener() {

			public void onChange(Widget sender) {
				//Window.alert("Date selected: " + calendar.getDate());
				CRMEntryPoint.get().changeRightPanel(new CalendarRightPanel(calendar.getDate().toString()));
			}
		});
		outer.add(calendar);

		initWidget(outer);
	}
}
